package cn.bitkit.tools.data;


import cn.bitkit.base.util.StringUtil;

public class ForeignerIdUtil {

    public static boolean check(String cardId){
        if(StringUtil.isEmpty(cardId)){
            return false;
        }
        if(cardId.length() > 24 || cardId.length() < 8){
            return false;
        }
        //如果是18位且以9开头的号码，则使用普通身份证校验规则
        if(cardId.length() == 18 && cardId.startsWith("9")){
            return IdCardUtil.check(cardId);
        }
        return true;
    }

    public static boolean isNewType(String cardId){
        if(StringUtil.isEmpty(cardId)){
            return false;
        }
        return cardId.length() == 18 && cardId.startsWith("9");
    }

}
